package com.iterator.self;


import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class ComputerCompanyIterator implements Iterator {

    List<Sector> sectorList;

    int index=-1;

    public ComputerCompanyIterator(List<Sector> sectorList) {
        this.sectorList = sectorList;
    }

    @Override
    public boolean hasNext() {
        if(index<sectorList.size()-1){
            index++;
            return true;
        }else {
            return false;
        }
    }

    @Override
    public Object next() {
        return sectorList.get(index);
    }

    @Override
    public void remove() {

    }
}
